<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h2>条件渲染</h2>
    <button v-on:click="show = !show">btn</button>
    <!-- v-if和v-else必须要紧挨着使用 -->
    <!-- <p v-if="show">Vue is awesome!</p>
    <p v-else>Oh no 😢</p> -->

    <p v-if="type === 1">111111111</p>
    <p v-else-if="type === 2">222222222</p>
    <p v-else>333333333</p>
  </div>

  <script src="../vue3.js"></script>
  <script>

    const {createApp} = Vue;
    createApp({
      data() {
        return {
          show: false,
          type: 2
        }
      }
    }).mount("#app");
  </script>
</body>
</html>